<{include file="public/header.html"}>
		<div class="xinsu-right">
			<div class="xinsu-right-content">
				<div class="xinsu-data-content">
					<div class="xinsu-title">
						<span class="layui-breadcrumb">
							<a href="/">当前位置</a>
							<a href="/<{$common_info.module}>/Sms/"><cite>短信管理</cite></a>
						</span>
					</div>
					
					<form class="layui-form xinsu-form" action="/<{$common_info.module}>/Sms/" method="get">
						<div class="layui-form-item">
							
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">时间</label>
								<div class="layui-input-inline xinsu-input-inline">
									<input type="text" name="begin_time" id="begin_time" lay-verify="date"  autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="<{if 0 != $begin_time}><{$begin_time}><{/if}>">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label xinsu-form-label">~</label>
								<div class="layui-input-inline xinsu-input-inline">
									<input type="text" name="end_time" id="end_time" lay-verify="date"  autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="<{if 0 != $end_time}><{$end_time}><{/if}>">
								</div>
							</div>

							<button class="layui-btn xinsu-btn">查询</button>
							<span>记录总数：共 <{$total}> 条</span>
						</div>
					</form>
					<div class="layui-form xinsu-form">
						<table class="layui-table">
							<thead>
								<tr>
									<th width="10%">ID</th>
									<th width="10%">手机号</th>
									<th>短信内容</th>
									<th width="10%">创建时间</th>
									<!-- <th width="10%">过期时间</th> -->
									<th width="10%">发送时间</th>
									<th width="10%">发送状态</th>
									<th width="10%">错误原因</th>
									<th width="10%">操作</th>
								</tr> 
							</thead>
							<tbody>
								<{if empty($list) == false}>
								<{foreach $list as $val}>
								<tr>
									<td><{$val.id}></td>
									<td><a href="javascript:" data="<{$val.userid}>" class="xinsu-fontcolor-blue xinsu-user"><{$val.username}>/<{$val.phone}></a></td>
									<td align="left"><div align="left"><a href="javascript:;" data-uri="/<{$common_info.module}>/sms/detail/<{$val.id}>" data-title="查看短信" class="xinsu-content xinsu-fontcolor-blue"><{mb_substr($val.content, 0, 20)}>...</a></left></td>
									<td><{date("Y-m-d H:i:s",$val["create_time"])}></td>
									<!-- <td><{date("Y-m-d",$val["expire_time"])}>|<{if $val["expire_time"]<time()}><font color="yellow">已过期</font><{else}>未过期<{/if}></td> -->
									<td><{date("Y-m-d H:i:s",$val["send_time"])}></td>
									<td><{if $val.delieve_flag == 1 }>已发送<{else}><font color="red">未发送</font><{/if}></td>
									<td><{if $val.delieve_flag == 0 }><font color="red"><{$val.delieve_info}></font><{/if}></td>
									<td>
										<!-- <{if $val["expire_time"]>time()}> -->
										<!-- <{if $val.send_flag==1}> -->
										<!-- <{else}> -->
										<!-- <a id="xinsu-status-<{$val.id}>" class="<{if $val.status == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}> xinsu-change-status" href="javascript:;" data="<{$val.id}>" ><{if $val.status == 1}>待发送<{else}>已取消<{/if}></a> -->
										<!-- <{/if}> -->
										<!-- <{/if}> -->
										<a class="xinsu-fontcolor-blue xinsu-delete" href="javascript:;" data="<{$val.id}>">删除</a>
									</td>
								</tr>
								<{/foreach}>
								<{else}>
								<tr>
									<td colspan="9">暂无数据</td>
								</tr>
								<{/if}>
							</tbody>
						</table>
					</div>
					<div class="xinsu-page">
						<div class="xinsu-show">
							<{$page}>
						</div>
						<div class="xinsu-clear"></div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(".xinsu-change-status").click(function(){
				var id = $(this).attr("data");
				var url="/<{$common_info.controller}>/change";
				http_request_post(url, {id:id}, function(result){
					if (result.status == 1) {
						layer.msg(result.msg, {icon: 1, time: 800}, function() {
								var res = eval(result.data);
								var id = res["id"];
								var value = res["value"];
								
								if (value == 0) {
									$("#xinsu-status-" + id).html("已取消");
									$("#xinsu-status-" + id).removeClass("xinsu-fontcolor-blue");
									$("#xinsu-status-" + id).addClass("xinsu-fontcolor-red");
								} else {
									$("#xinsu-status-" + id).html("待发送");
									$("#xinsu-status-" + id).removeClass("xinsu-fontcolor-red");
									$("#xinsu-status-" + id).addClass("xinsu-fontcolor-blue");
								}
							});
					} else {
						layer.msg(result.msg);
					}
				});
			});
		</script>
<{include file="public/footer.html"}>